package com.hnkywl.sts.entity.base;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.sys.Yg;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-5-20
 * Time: 下午8:39
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_SYS_GSPZ")
@Where(clause = "deleted!='1'")
public class Gspz extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqGspz", allocationSize = 1, sequenceName = "SEQ_SYS_GSPZ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqGspz")
    private Long id;

    //名称
    private String mc;

    //设置人
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SZR_ID")
    private Yg szr;

    //截止日期
    private Date jzrq;

    //状态
    private String zt;

    //是否启用
    private Boolean sfqy = false;

    //按吨收取
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Adsq.class)
    @JoinColumn(name = "GSPZ_ID")
    private List<Adsq> adsqList;

    //按天收取
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Atsq.class)
    @JoinColumn(name = "GSPZ_ID")
    private List<Atsq> atsqList;


    //是否客户付款日期
    private Boolean sfkhfkrq = false;

    //客户付款日期
    private Date khfkrq;

    public Date getKhfkrq() {
        return khfkrq;
    }

    public void setKhfkrq(Date khfkrq) {
        this.khfkrq = khfkrq;
    }

    public Boolean getSfkhfkrq() {
        return sfkhfkrq;
    }

    public void setSfkhfkrq(Boolean sfkhfkrq) {
        this.sfkhfkrq = sfkhfkrq;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public Yg getSzr() {
        return szr;
    }

    public void setSzr(Yg szr) {
        this.szr = szr;
    }

    public Date getJzrq() {
        return jzrq;
    }

    public void setJzrq(Date jzrq) {
        this.jzrq = jzrq;
    }

    public String getZt() {
        return zt;
    }

    public void setZt(String zt) {
        this.zt = zt;
    }

    public Boolean getSfqy() {
        return sfqy;
    }

    public void setSfqy(Boolean sfqy) {
        this.sfqy = sfqy;
    }

    public List<Adsq> getAdsqList() {
        return adsqList;
    }

    public void setAdsqList(List<Adsq> adsqList) {
        this.adsqList = adsqList;
    }

    public List<Atsq> getAtsqList() {
        return atsqList;
    }

    public void setAtsqList(List<Atsq> atsqList) {
        this.atsqList = atsqList;
    }
}
